LassoScript Utility
Basics Browse Detail

[RegExp->ReplaceFirst]

Tag Link [RegExp->ReplaceFirst] Category String
Type Member Source Available Yes
Support Preferred Version 8.5
Change New Data Source Any
Output Type None Security None
Implementation Sets Lasso 8.5

Description

[RegExp->ReplaceFirst] is a utility tag which replaces the first instance of the find pattern in the input string with the replacement pattern and returns the result. The tag accepts optional parameters to override the -Find, -Replace, or -Input with new values.

The [RegExp->ReplaceAll] tag functions similarly, but replaces every instance of the find pattern in the input string with the replement pattern.

Usually this tag will be used to apply the same find and replacement pattern against several different inputs. Since the find and replacement patterns are only compiled once a series of search/replace operations on different strings can be performed faster than with individual [String_ReplaceRegExp] tags.

Syntax

[(RegExp: -Find='[aeiou]', -Replace='*', -Input='The quick brown fox', -IgnoreCase)->ReplaceFirst]

Parameters

Optional Parameters
-Find Specifies a new find pattern to use for the search/replace operation. Defaults to the current stored find pattern.
-Replace Specifies a new replacement pattern to use for the search/replace operation. Defaults to the current stored replacement pattern.
-Input Specifies the input to run the search/replace operation on. Defaults to the current stored input string.
-IgnoreCase If specified the search/replace operation is performed without regard to case. Defaults to the current setting in the regular expression type.

Examples

See the Lasso 8 Language Guide for examples of how to use this tag.

Related Tags

Category Tags

Substitution
[String]
[String_CharFromName]
[String_Concatenate]
[String_EndsWith]
[String_Extract]
[String_FindPosition]
[String_FindRegExp]
[String_GetUnicodeVersion]
[String_Insert]
[String_IsAlpha]
[String_IsAlphaNumeric]
[String_IsDigit]
[String_IsHexdigit]
[String_IsLower]
[String_IsNumeric]
[String_IsPunctuation]
[String_IsSpace]
[String_IsUpper]
[String_Length]
[String_LowerCase]
[String_Remove]
[String_RemoveLeading]
[String_RemoveTrailing]
[String_Replace]
[String_ReplaceRegExp]
[String_UpperCase]
[String_ValidCharset]
Member
[String->Append]
[String->BeginsWith]
[String->CharDigitValue]
[String->CharName]
[String->CharType]
[String->Compare]
[String->CompareCodePointOrder]
[String->Contains]
[String->CountChar32]
[String->Digit]
[String->EndsWith]
[String->Equals]
[String->Find]
[String->FoldCase]
[String->Get]
[String->GetNumericValue]
[String->Integer]
[String->IsAlnum]
[String->IsAlpha]
[String->IsBase]
[String->IsCntrl]
[String->IsDigit]
[String->IsLower]
[String->IsPrint]
[String->IsSpace]
[String->IsTitle]
[String->IsUAlphabetic]
[String->IsULowerCase]
[String->IsUWhiteSpace]
[String->IsUpper]
[String->IsWhiteSpace]
[String->Lowercase]
[String->Merge]
[String->PadLeading]
[String->PadTrailing]
[String->Remove]
[String->RemoveLeading]
[String->RemoveTrailing]
[String->Replace]
[String->Reverse]
[String->Size]
[String->Split]
[String->Substring]
[String->TitleCase]
[String->ToLower]
[String->ToTitle]
[String->ToUpper]
[String->Trim]
[String->Unescape]
[String->Uppercase]
[String->WasKeyword]
[String->isUUpperCase]